#include "databaseoperator.h"
DatabaseOperator::DatabaseOperator(QSqlDatabase* connection)
{
    this->connection=connection;
    connection->exec("CREATE TABLE IF NOT EXISTS task(name varchar(100) not null,filename varchar(100) not null,taskdate date not null)");
    connection->exec("CREATE TABLE IF NOT EXISTS metaData(key varchar(100) not null,value varchar(100) not null)");
}

DatabaseOperator::~DatabaseOperator()
{

}

void DatabaseOperator::SetMetaData(QString &key, QString &value){

}
bool DatabaseOperator::contains(QString &tableName, QString &columnName, QString &value){
    QSqlQuery query("select * from "+tableName+" where "+columnName+" = "+value,*connection);
    return query.next();
}
